home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 7
/
Apprentice-Release7.iso
/
Source Code
/
Pascal
/
Snippets
/
PNL Libraries
/
Assembly
/
PreserveA5.a
< prev
next >
Wrap
Text File
|
1995-06-12
|
842b
|
45 lines
include 'sysequ.a'
include 'traps.a'
proc
export SetupPreserveA5, SetPreservedA5, RestoreA5, PreCompletion, SavedA5Value;
; procedure SetupPreserveA5;
SetupPreserveA5
lea SavedA5Value,a0
move.l a5,(a0)
rts
; function SetPreservedA5:Ptr;
SetPreservedA5
move.l a5,4(sp)
move.l SavedA5Value,a5
rts
; procedure RestoreA5(olda5:Ptr);
RestoreA5
move.l 4(sp),a5
move.l (sp)+,(sp)
rts
; procedure PreCompletion(a0 : ParamBlocPtr);
PreCompletion
move.l a5,-(SP) ; Preserve A5 register.
move.l SavedA5Value,A5 ; Set A5 to passed value (SavedA5Value).
move.l a0, -(SP) ; Pass PB pointer as the parameter.
move.l -4(A0),A0 ; A0 = real completion routine address.
JSR (A0) ; Transfer control to ourCompletion.
move.l (SP)+,A5 ; Restore A5 register.
rts
SavedA5Value ds.l 1
endp
end
asm -wb "{active}"